#include "ColorLaneSensor.hpp"
#include "Hardware.hpp"

ColorLaneSensor::ColorLaneSensor(Side aSide) :
	side(aSide)
{

}

/**
 * In absence of threads we'll have to poll each sensor manually
 * This method should only return true when the robot is on a color lane
 */
bool ColorLaneSensor::poll()
{
	switch (side)
	{
		case CENTRALLEFT: return Hardware::getHardwareController().pollColorlaneLeft();
		case CENTRALRIGHT: return Hardware::getHardwareController().pollColorlaneRight();
		default: return 0;
	}
}

Sensor::SensorType ColorLaneSensor::getSensorType()
{
	return Sensor::COLORLANE;
}

Side ColorLaneSensor::getSide()
{
	return side;
}
